package com.xposed.aliproxy.xposed;

import android.content.Context;

import com.xposed.aliproxy.utils.DateUtil;
import com.xposed.aliproxy.utils.XposeUtil;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XC_MethodHook.MethodHookParam;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;

public class AliHookMethodc extends XC_MethodHook {
    private ClassLoader classLoader;
    private Context context;

    public AliHookMethodc(Context context, ClassLoader classLoader) {
        this.context = context;
        this.classLoader = classLoader;
    }

    @Override
    protected void beforeHookedMethod(MethodHookParam methodHookParam) throws Throwable {
        try {
            String replace = XposeUtil.m3001b((String) XposedHelpers.callMethod(methodHookParam.args[0], "toString", new Object[0]), "extraInfo='", "'").replace("\\", "");
            XposeUtil.xposedLog("AliHookMethod4_string->", replace);
            if (replace.contains("收钱到账") || replace.contains("收款到账")) {
                XposeUtil.xposedLog("currentTimeMillis->", DateUtil.formatData("yyyyMMddHHmmssSSS"));
                XposeUtil.m3002b(this.context, XposeUtil.xposedAmnetUserInfo(this.classLoader));
                super.beforeHookedMethod(methodHookParam);
            }
        } catch (Throwable th) {
            XposedBridge.log(th);
        }
    }
}
